<?php
class Homepage_MobileController extends Ac_Controller_Mobile
{
	 public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $this->_helper->layout->setLayout('layout-mobile2');
		//$this->view->main_content = "mobile/homepage.phtml";
		$this->view->module_content = "homepage";
        //today's pick
        //2011-03-04
        $arr = array(                
                new MongoId('4d705e37b7ca870e3407cb41'),
                new MongoId('4d6f9e3ab7ca870e34078424'),
                new MongoId('4d6f4b6cb7ca870e34075697'),
                new MongoId('4d6f59abb7ca870e34075db4'),
                new MongoId('4d6f4a10b7ca870e340755ef'),
                new MongoId('4d6f0fc0b7ca870e340732e0'),
                new MongoId('4d6e0cdbb7ca870e3406c8d4'),
                new MongoId('4d6dc03eb7ca870e3406a7e5'),
                new MongoId('4cf9b814e62d6c592062fb00'),
                new MongoId('4d6bcd7ab7ca870e3405a1b6'),
                new MongoId('4d69d29db7ca870e3404a4bf'),
                new MongoId('4d68c3bab7ca870e34042eb2'),
                new MongoId('4d65f143b7ca870e34032a40'),
                new MongoId('4d652a83b7ca870e3402f5ed'),
                new MongoId('4d6519d8b7ca870e3402ef6a'),
                new MongoId('4d63cba9b7ca870e34028a3b'),
                new MongoId('4d2e8181e62d6cde3d00014b'),
                new MongoId('4d63780bb7ca870e34026478'),
                new MongoId('4d6377adb7ca870e3402643d'),
        );
        
        shuffle($arr);
        $arr = array_slice($arr, 0, 6);
                
        //$res = Model_Listing::all(array('_id' => array('$in' => $arr)));
        $list = array();
        foreach($arr as $val) {
            $tmp =  Model_Listing::find($val);
            if (!empty($tmp)) {
                $list[] = $tmp;
            }
        }
        
        
        $this->view->todayspick = $list;
        $this->render('homepage');
    }
}


?>